package org.lee.visitor.app;

import org.lee.visitor.app.user.Grade;
import org.lee.visitor.app.user.Identity;
import org.lee.visitor.app.user.User;
import org.lee.visitor.app.user.impl.Student;
import org.lee.visitor.app.user.impl.Teacher;
import org.lee.visitor.app.visitor.Visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * DataView
 * 数据板
 *
 * @author dralee
 * @date 2021-11-24 14:14:13
 **/
public class DataView {

    List<User> userList = new ArrayList<>();

    public DataView() {
        userList.add(new Student("张三", Identity.KEY_CLASS, Grade.GRADE_ONE, 1));
        userList.add(new Student("李四", Identity.KEY_CLASS, Grade.GRADE_ONE, 1));
        userList.add(new Student("王五", Identity.ORDINARY_CLASS, Grade.GRADE_TWO, 3));
        userList.add(new Student("赵六", Identity.ORDINARY_CLASS, Grade.GRADE_THREE, 5));
        userList.add(new Student("小七", Identity.ORDINARY_CLASS, Grade.GRADE_THREE, 2));
        userList.add(new Teacher("老黄", Identity.SUPER_TEACHER, Grade.GRADE_ONE, 1));
        userList.add(new Teacher("老杨", Identity.ORDINARY_TEACHER, Grade.GRADE_ONE, 1));
        userList.add(new Teacher("小金", Identity.ORDINARY_TEACHER, Grade.GRADE_TWO, 3));
        userList.add(new Teacher("小方", Identity.INTERN_TEACHER, Grade.GRADE_THREE, 5));
        userList.add(new Teacher("老龚", Identity.ORDINARY_CLASS, Grade.GRADE_THREE, 2));
    }

    public void show(Visitor visitor) {
        for (User user : userList) {
            user.accept(visitor);
        }
    }
}
